import bus from '@/bus'
import { formatDate } from '@/util'
import dayjs from 'dayjs'
const startReportDate = dayjs().format('YYYY-MM') + '-01' + ' 00:00:00'
const endReportDate = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
let data = {
  status: 'pass',
  totalItem: 0,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    distributorId: '',
    storeId: '',
    // date: [formatDate(new Date(new Date() - 1000 * 60 * 60 * 24 * 30)), formatDate(new Date())],
    date: [startReportDate, endReportDate],
    barcode: '',
    brandId: null,
    productIds: null,
    salesmanSalesId: '',
    factoryTagId: '',
    purchOrderSn: ''
  },
  columns: [{
    title: '经销商',
    key: 'distributorName',
    align: 'left',
    minWidth: 200,
    tooltip: true
  }, {
    title: '门店名称',
    key: 'storeName',
    align: 'left',
    minWidth: 200,
    tooltip: true
  }, {
    title: '商品名称',
    key: 'title',
    align: 'left',
    minWidth: 200,
    tooltip: true
  }, {
    title: '品牌',
    key: 'brandName',
    align: 'left',
    minWidth: 150
  }, {
    title: '特价类型',
    key: 'factoryTags',
    align: 'left',
    minWidth: 150
  }, {
    title: '门店联系人',
    key: 'storeContact',
    align: 'left',
    minWidth: 150
  }, {
    title: '门店维护人',
    key: 'salesmanSalesName',
    align: 'left',
    minWidth: 150
  }, {
    title: '单号',
    key: 'purchOrderSn',
    align: 'left',
    minWidth: 250
  }, {
    title: '订单时间',
    key: 'reportDate',
    align: 'left',
    minWidth: 200
  }, {
    title: '单据订货',
    key: 'retainQuantity',
    align: 'right',
    minWidth: 100,
    render: (h, params) => {
        return h('a', {
            on: {
                click: () => {
                    bus.$emit('onOpenSn', { item: params.row.purchOrderSn })
                }
            }
        }, params.row.retainQuantity)
    }
      
  }, {
    title: '单据发货',
    key: 'shipQuantity',
    align: 'right',
    minWidth: 100
  }, {
    title: '单据排单',
    key: 'singleRowQuantity',
    align: 'right',
    minWidth: 100
  }, {
    renderHeader: (h, p) => {
        let inner = h('div', [
          h('span', '入库匹配'),
          h('Icon', {
            props: {
              type: 'ios-help-circle'
            }
          })
        ])
        return h('Tooltip', {
          props: {
            content: '门店扫码入库匹配的数量',
            placement: 'top',
            transfer: true
          }
        }, [inner])
    },
    key: 'matchQuantity',
    align: 'right',
    minWidth: 150,
    render: (h, params) => {
        return h('a', {
            on: {
                click: () => {
                    bus.$emit('onOpenNum', { item: params.row })
                }
            }
        }, params.row.matchQuantity)
    }
  }, {
    title: '特价编号',
    key: 'factoryTagId',
    align: 'left',
    minWidth: 150
  }, {
    title: '规格',
    key: 'tireSpec',
    align: 'left',
    minWidth: 150
  }, {
    title: '尺寸',
    key: 'tireRim',
    align: 'left',
    minWidth: 150
  }, {
    title: '花纹',
    key: 'tireFigure',
    align: 'left',
    minWidth: 150
  }],
    data:[]
}
export default data